<template>
  <van-tabbar v-model="active" route :active-color="rgba[2]">
    <van-tabbar-item icon="home-o" to="/">主页</van-tabbar-item>
    <van-tabbar-item icon="star-o" to="/coll">试题收藏</van-tabbar-item>
    <van-tabbar-item icon="user-o" to="/user">个人中心</van-tabbar-item>
  </van-tabbar>
</template>

<script>
export default {
  name: "tabBar",
  data() {
    return {
      active: 0,
      rgba: []
    };
  },
  created() {
    this.backrgba();
  },
  methods: {
    backrgba() {
      if (this.rgba.length == 0) {
        this.rgba[2] = "rgb(65, 153, 240)";
      } else {
        this.rgba = JSON.parse(localStorage.getItem("bakcColor"));
      }
    }
  }
};
</script>

<style lang="scss">
.van-tabbar {
  margin-bottom: -4px;
}
</style>